<template>
	<view class="flex-col page">
		<view class="flex-col group_1">
			<view class="flex-col group_2">
				<view class="flex-col section_1">
					<view class="flex-col">
						<view class="justify-between">
							<text class="text_1 text_2">我的资产（元）</text>
							<view class="flex-row group_5">
								<text class="text_1 text_3" @click="onClickText_34">提现</text>
								<image
									src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558034208388390061.png"
									class="image_3" @click="onClickImage_5" />
							</view>
						</view>
						<text class="text_1 text_4">{{  info.balance }}</text>
					</view>
					<view class="justify-between group_6" v-if="true">
						<text class="text_1 text_5">昨日收益：￥{{ info.ysterdayMoney }}</text>
						<text class="text_1 text_6">累计收益：￥{{ info.sumMoney }}</text>
					</view>

					<!--          <view class="justify-between group_6" v-else>
            <text class="text_1 text_5">昨日收益：￥{{ list_NVILQcVz[0].yesterdayMoney ? parseFloat(list_NVILQcVz[0].yesterdayMoney).toFixed(2) : '0.00' }}</text>
            <text class="text_1 text_6">累计收益：￥{{ list_NVILQcVz[0].accumulatedEarnings ? parseFloat(list_NVILQcVz[0].accumulatedEarnings).toFixed(2) : '0.00' }}</text>
          </view>-->
				</view>
				<view class="justify-between group_7">
					<view class="flex-row group_8">
						<image
							src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558030332466756707.png"
							class="image_4" />
						<text class="text_7">账单明细</text>

					</view>
					<view class="flex-row group_9">
						<view style="display: flex;align-items: center;">
							<uni-data-select v-model="value" :localdata="range" @change="change" :clear="false">
							</uni-data-select>
							<image
								src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62ac1d455a7e3f03100b6468/62b188edd029820011534ee0/16558073061822971962.png"
								class="image_34 " />
						</view>
					</view>
				</view>
			</view>
			<view class="list">
				<view class="" style="text-align: center;margin-top: 50rpx;" v-if="list.puserBills.length==0">
					<image src="../../static/dingdan.png" mode="scaleToFill"
						style="margin-top: 100rpx;width: 150rpx;height: 160rpx;"></image>
					<view class="" style="color: #999;font-size: 28rpx;margin-top: 20rpx;">
						暂无数据
					</view>
				</view>
				<view class="flex-col list-item" :key="i" v-for="(item, i) in list.puserBills">
					<view class="justify-between group_10">
						<text class="text_9">{{ item.type == 0 ? '支出' : '收入' }}</text>
						<view class="group_11">
							<text class="text_11">{{ item.type == 0 ? '-' : '+' }}</text>
							<text class="text_13">{{ item.number }}</text>
						</view>
					</view>
					<view class="justify-between group_12">
						<!--            <text class="text_15">成功提现到银行卡</text>-->
						<view class="flex-row group_13">
							<text class="text_17">{{ item.createTime }}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getMyWallet
	} from '../../api/api.js'
	export default {
		components: {},
		data() {
			return {
				info: {},
				list_NVILQcVz: [],
				value: 0,
				range: [{
						value: 0,
						text: "本年"
					},
					{
						value: 1,
						text: "本月"
					},
					{
						value: 2,
						text: "本天"
					},
				],
				list:{
          puserBills: []
        },
				pageInfo: {
					pageIndex: 1,
					pageSize: 20
				}
			};
		},
		created() {
			this.getPersonWallet()
		},
    onReachBottom() {
      this.pageInfo.pageIndex += 1
      this.getPersonWallet()
    },
		methods: {
			getPersonWallet() {
				getMyWallet(this.value, this.pageInfo.pageSize,this.pageInfo.pageIndex).then(res => {
          if (!this.info.balance) {
            this.info.balance = res.data.balance
            this.info.ysterdayMoney = res.data.ysterdayMoney
            this.info.sumMoney = res.data.sumMoney
          }
          this.list.puserBills = this.list.puserBills.concat(res.data.puserBills)
				})
			},
			// getPersonWalletNowMoney() {
			//   getPersonWalletNowMoney(this.$store.state.userInfo.wxInfo.uid).then(res => {
			//     this.info = res.data
			//   })
			// },
			// getPersonWallet() {
			//   getPersonWallet(this.$store.state.userInfo.wxInfo.uid, this.value, this.pageInfo).then(res => {
			//     this.list_NVILQcVz = this.list_NVILQcVz.concat(res.data.list)
			//     console.log('this.list_NVILQcVz', this.list_NVILQcVz)
			//   })
			// },
			change(e) {
				this.value = e
				this.getPersonWallet()
			},
			clearSearch() {
				this.list_NVILQcVz = []
				this.pageInfo.pageIndex = 1
			},
			onClickText_34() {
				uni.showToast({
					title: '提现正在审核中！',
					icon: 'none'
				})
				return
				uni.navigateTo({
					url: '/pages/tixian/tixian'
				});
			},
			onClickImage_5() {
				uni.navigateTo({
					url: '/pages/tixian/tixian'
				});
			},
		},
	};
</script>

<style scoped lang="css">
	.image_34 {
		flex-shrink: 0;
		width: 0.41rem;
		height: 0.31rem;
	}

	::v-deep .uni-stat__select {
		color: #fff !important;
		border: 0 !important;
		font-size: 14px;
		margin-right: 10vw;
		padding: 0 !important;
	}


	::v-deep .uni-stat__actived {
		width: 0 !important
	}

	::v-deep .uni-select {
		padding: 0 !important;
		width: 30px !important;
		border: 0 !important;
	}

	::v-deep .uni-select__input-text {
		padding: 0 !important;
	}

	::v-deep .uni-select__selector {
		width: 100rpx;
	}

	::v-deep .uni-select__selector-item {
		color: #000 !important;
		width: 100rpx !important;
	}

	::v-deep .uni-input-placeholder {}

	.list-item {
		padding: 1.22rem 0.28rem 1.22rem 0.91rem;
		background-color: #ffffff;
		border-radius: 0.47rem;
		width: 92vw;
	}

	.group_10 {
		padding-left: 0.063rem;
	}

	.group_12 {
		margin-top: 0.53rem;
	}

	.text_1 {
		text-transform: uppercase;
	}

	.text_9 {
		margin-bottom: 0.094rem;
		color: #333333;
		font-size: 0.88rem;
		font-family: SourceHanSansCN;
		font-weight: 700;
		line-height: 0.84rem;
		text-transform: uppercase;
	}

	.group_11 {
		line-height: 0.97rem;
		height: 0.97rem;
	}

	.text_15 {
		color: #999999;
		font-size: 0.75rem;
		font-family: SourceHanSansCN;
		line-height: 0.75rem;
		text-transform: uppercase;
	}

	.group_13 {
		margin-right: 0.28rem;
		margin-top: 0.094rem;
	}

	.text_11 {
		color: #e65943;
		font-size: 0.88rem;
		font-family: SourceHanSansCN;
		font-weight: 700;
		line-height: 0.56rem;
		text-transform: uppercase;
	}

	.text_13 {
		color: #e65943;
		font-size: 1.19rem;
		font-family: SourceHanSansCN;
		font-weight: 700;
		line-height: 0.97rem;
		text-transform: uppercase;
	}

	.text_17 {
		color: #888888;
		font-size: 0.75rem;
		font-family: SourceHanSansCN;
		line-height: 0.59rem;
		text-transform: uppercase;
	}

	.text_19 {
		color: #888888;
		font-size: 0.75rem;
		font-family: SourceHanSansCN;
		line-height: 0.59rem;
		text-transform: uppercase;
	}

	.page {
		background-color: #f5f5f5;
		border-bottom: solid 0.28rem #ffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group_1 {
		padding-top: 0.94rem;
		flex: 1 1 auto;
		overflow-y: auto;
    height: 100vh;
	}

	.group_2 {
		padding: 0 0.94rem;
	}

	.list {
		padding: 0 0.94rem;
		height: 23.69rem;
		position: relative;
		flex-wrap: wrap;
	}

	.section_1 {
		padding: 1.53rem 0.56rem 1.44rem 1.25rem;
		filter: drop-shadow(0px 0.47rem 0.7rem #2569ff1a);
		border-radius: 0.47rem;
		background-image: url('@/static/backsqianbao.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}

	.group_7 {
		padding: 1.28rem 0 0.59rem;
	}

	.group_6 {
		margin-top: 1.72rem;
	}

	.group_8 {
		margin-top: 0.094rem;
	}

	.group_9 {
		margin-right: 0.094rem;
	}

	.text_4 {
		margin-top: 1.38rem;
		align-self: flex-start;
		color: #ffffff;
		font-size: 2.38rem;
		font-family: SourceHanSansCN;
		font-weight: 700;
		line-height: 2.28rem;
	}

	.text_5 {
		color: #ffffff;
		font-size: 0.75rem;
		font-family: SourceHanSansCN;
		line-height: 0.72rem;
	}

	.text_6 {
		color: #ffffff;
		font-size: 0.75rem;
		font-family: SourceHanSansCN;
		line-height: 0.72rem;
	}

	.image_4 {
		margin-top: 0.16rem;
		flex-shrink: 0;
		width: 0.31rem;
		height: 0.94rem;
	}

	.text_7 {
		margin-left: 0.31rem;
		margin-bottom: 0.16rem;
		color: #333333;
		font-size: 1rem;
		font-family: SourceHanSansCN;
		font-weight: 500;
		line-height: 0.94rem;
		text-shadow: 0px 0px 0.88rem #3030301a;
	}

	.text_8 {
		color: #333333;
		font-size: 0.81rem;
		font-family: SourceHanSansCN;
		line-height: 0.78rem;
	}

	.image_5 {
		margin: 0.19rem 0 0.25rem 0.16rem;
		flex-shrink: 0;
		width: 0.63rem;
		height: 0.34rem;
	}

	.text_2 {
		margin-bottom: 0.094rem;
		color: #ffffff;
		font-size: 0.81rem;
		font-family: SourceHanSansCN;
		line-height: 0.78rem;
	}

	.group_5 {
		margin-right: 0.34rem;
	}

	.text_3 {
		color: #ffffff;
		font-size: 1rem;
		font-family: SourceHanSansCN;
		line-height: 0.94rem;
	}

	.image_3 {
		margin-left: 0.25rem;
		margin-top: 0.13rem;
		flex-shrink: 0;
		width: 0.41rem;
		height: 0.75rem;
	}

	.uni-select__input-text {
		width: 100%;
		color: #333;
		white-space: nowrap;
		text-overflow: ellipsis;
		-o-text-overflow: ellipsis;
		overflow: hidden;
	}
</style>
